package com.ztest.statustrans;

import com.apop.MainApplication;
import lombok.Data;
import lombok.extern.slf4j.Slf4j;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;

import javax.annotation.Resource;
import java.time.LocalDateTime;

@RunWith(SpringRunner.class)
@SpringBootTest(classes = MainApplication.class)
@Slf4j
public class OrderTransDemo {

    OrderStateService service = new OrderStateService();

    @Test
    public void m1(){

        // 创建订单
        OrderDO orderDO = new OrderDO();
        orderDO.setStatus(OrderStateEnum.WAIT_PAYMENT);
        log.info("订单状态为 >> {} ",orderDO.getStatus().getDesc());

        log.info("====订单支付====");
        // 订单支付
        service.pay(orderDO);
        // 结果
        log.info("订单状态为 >> {} ",orderDO.getStatus().getDesc());

    }

}
